-- GENERATED SPELL FOR [Captain Keelhaul] --


function spell0_2548(pUnit, Event) --@Demoralizing Shout,Self--
pUnit:FullCastSpellOnTarget(13730,pUnit)
pUnit:RegisterEvent('Sorts_2548', 30345, 1)
end

function spell1_2548(pUnit, Event) --@Exploding Shot,n/a--
pUnit:FullCastSpellOnTarget(7896,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_2548', 1000, 1)
end

function spell2_2548(pUnit, Event) --@Shoot,n/a--
pUnit:FullCastSpellOnTarget(6660,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_2548', 572, 1)
end

function Sorts_2548(pUnit, Event)
local choix_sorts_2548 = math.random(0, 2)
if choix_sorts_2548 == 0 then
pUnit:RegisterEvent('spell0_2548', 1, 1)
end
if choix_sorts_2548 == 1 then
pUnit:RegisterEvent('spell1_2548', 1, 1)
end
if choix_sorts_2548 == 2 then
pUnit:RegisterEvent('spell2_2548', 1, 1)
end
end

function mob2548_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_2548', math.random(1500, 3000), 1)
end

function mob2548_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob2548_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob2548_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(2548, 1, 'mob2548_Action')
RegisterUnitEvent(2548, 2, 'mob2548_Leave')
RegisterUnitEvent(2548, 3, 'mob2548_Kill')
RegisterUnitEvent(2548, 4, 'mob2548_Die')
